<?php

/**
 * SpiderResult form base class.
 *
 * @method SpiderResult getObject() Returns the current form's model object
 *
 * @package    sfproject
 * @subpackage form
 * @author     Sergey Shadrin
 */
abstract class BaseSpiderResultForm extends BaseFormPropel
{
  public function setup()
  {
    $this->setWidgets(array(
      'spider_result_id' => new sfWidgetFormInputHidden(),
      'page_content'     => new sfWidgetFormTextarea(),
    ));

    $this->setValidators(array(
      'spider_result_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->getSpiderResultId()), 'empty_value' => $this->getObject()->getSpiderResultId(), 'required' => false)),
      'page_content'     => new sfValidatorString(array('required' => true)),
    ));

    $this->widgetSchema->setNameFormat('spider_result[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    parent::setup();
  }

  public function getModelName()
  {
    return 'SpiderResult';
  }


}
